<div class="SipeiMain_r fr">
    <h2 class="clearfix fonts_18 height45 fontc_444"><?php echo $title; ?></h2>
    <div class="clearfix back_bgf border_c mt15 pt20 pb20">
        <div class="clearfix pb20 pl30"><input type="button" onclick="subordinateadd(<?php echo $membership_id; ?>)" value="新增" class="b_a_n border_3 back_bgfb w80 height32 fontc_FFF fonts_12 cursor fr mr20" /></div>
        <form>
            <table class="height40">
                <thead class="back_bgf5 fontc_999">
                    <tr>
                        <th width="135" align="center" class="m_hr_t m_hr_b">学校</th>
                        <th colspan="6" width="340" align="center" class="m_hr_t m_hr_b">有高考意向</th>
                        <th colspan="3" width="200" align="center" class="m_hr_t m_hr_b">无高考意向</th>
                        <th width="138" align="center" class="m_hr_t m_hr_b">操作</th>
                    </tr>
                </thead>
                <tbody class="fontc_444">
                    <tr>
                        <td align="center" class="m_hr_b"></td>
                        <td width="20" align="center" class="m_hr_b"></td>
                        <?php foreach ($subject_array[1] as $subVal): ?>
                            <td width="50" align="center" class="m_hr_b"><?php echo $subVal['mt_name']; ?></td>
                        <?php endforeach; ?>
                        <td width="20" align="center" class="m_hr_b"></td>
                        <?php foreach ($subject_array[0] as $subVal): ?>
                            <td width="50" align="center" class="m_hr_b"><?php echo $subVal['mt_name']; ?></td>
                        <?php endforeach; ?>
                        <td align="center" class="m_hr_b"></td>
                    </tr>
                    <?php if (!empty($school_num)): ?>
                  
                        <?php foreach ($school_num as $sk => $sValue): ?>
                            <tr class="back_bgfcb">
                                <td align="center" class="m_hr_b"><?php echo $sValue['school_name']; ?></td>
                                <td align="center" class="m_hr_b"></td>
                                <?php if(!empty($sValue[1])): ?>
                                <?php foreach ($sValue[1] as $cV): ?>
                                    <td align="center" class="m_hr_b"><?php echo $cV; ?></td>
                                <?php endforeach; ?>
                                <?php endif;?>
                                <td align="center" class="m_hr_b"></td>
                                <?php if (!empty($sValue[0])): ?>
                                <?php foreach ($sValue[0] as $csV): ?>
                                    <td align="center" class="m_hr_b"><?php echo $csV; ?></td>
                                <?php endforeach; ?>
								<?php endif;?>
                                <td align="center" class="m_hr_b">
                                    <a onclick="editsubordinate(<?php echo $sk; ?>,<?php echo $membership_id; ?>)" title="编辑" class="mr10"><img src="/themes/default/images/Sipei/edit.png" /></a>
                                    <a onclick="deletesubordinate(<?php echo $sk; ?>,<?php echo $membership_id; ?>, $(this))" title="删除"><img src="/themes/default/images/Sipei/delate.png" /></a></td>
                            </tr>
                        <?php endforeach; ?>
                    <?php endif; ?>
                </tbody>
            </table>
        </form>
        <!--分页-->
    </div>
</div>

<script type="text/javascript" >
            var api;
            function subordinateadd(membership_id)
            {
                api = $.dialog({
                    id: 'testID2',
                    lock: true,
                    fixed: true,
                    title: "新增",
                    width: 500,
                    height: 580,
                    max: false,
                    min: false
                });
                $.get('/membership/default/subordinateadd', {membership_id: membership_id,time:new Date()}, function(data) {
                    api.content(data);
                });
            }
            function deletesubordinate(sk, membership_id, $this) {
                $.dialog.confirm('确定删除吗', function() {
                     $.get('/membership/default/deletesubordinate', {school_id: sk, membership_id: membership_id}, function(data) {
                        if (data == 1) {
                            $this.parents("tr").remove();
                        } else {
                            alert("删除失败");
                        }
                    });
                });
            }
            function editsubordinate(sk, membership_id)
            {
                api = $.dialog({
                    id: 'testID2',
                    lock: true,
                    fixed: true,
                    title: "编辑",
                    width: 500,
                    height: 580,
                    max: false,
                    min: false
                });
                $.get('/membership/default/subordinateadd', {school_id: sk, membership_id: membership_id,time:new Date()}, function(data) {
                    api.content(data);
                });
            }
</script>